package com.itcast.peft.service.washrule;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import com.itcast.peft.service.InteractionDataWasher.WashedData;
import com.itcast.peft.service.InteractionDataWasher.WashedDataRule;

/**
 * 
 * 清洗规则：一个问题的回答数量必须大于等于指定的配置
 *
 */
@Component
public class MiniReplyRule implements WashedDataRule {

    @Value("${interaction.reply.min:2}")
    private int replyMin;

    @Override
    public boolean test(WashedData t) {
        return t.getAllReply().size() >= replyMin;
    }

}
